public class TestDemol {
    public static void eatFood(Animal a){
        a.eat();
    }
    public static void main(String[] args){
        //直接赋值：
        Animal dog = new Dog("旺财",10);
        //方法传参：
        Cat cat = new Cat("咪咪",5);
        eatFood(cat);
        dog.eat();
        Animal animal = (Cat)cat;
        cat.eat();

    }
}
